<!--
 * @Description: 
 * @Author: william
 * @Date: 2024-08-22 11:47:45
 * @LastEditors: william
 * @LastEditTime: 2025-06-13 09:46:17
-->
<template>
  <nw-PageTitle :title="title" isBack />
  <web-view :src="path"></web-view>
</template>

<script setup>
const props = defineProps({
  type: {
    type: String,
    default: ''
  }
})

const path = ref('')
const title = ref('')
const dataMap = {
  yhfwxy: {
    path: `https://iot.neoway.com/channel-doc/agreement/%E6%9C%89%E6%96%B9%E5%BC%80%E6%94%BE%E5%B9%B3%E5%8F%B0%E6%9C%8D%E5%8A%A1%E5%8D%8F%E8%AE%AE.html?_t=${+new Date()}`,
    title: g_t('login.userAgreement')
  },
  yxbhxy: {
    path: `https://iot.neoway.com/channel-doc/agreement/%E9%9A%90%E7%A7%81%E6%94%BF%E7%AD%96.html?_t=${+new Date()}`,
    title: g_t('login.privacyAgreement')
  },
  bzsc: {
    path: 'https://iot.neoway.com/channel-doc/',
    title: g_t('user.helpManual')
  }
}

onLoad(options => {
  console.log('protocol页面参数-options', options)
  path.value = dataMap[options.type].path || ''
  title.value = dataMap[options.type].title || g_t('user.agreement')
  if (options.type === 'bzsc') useBackPress()
})
</script>
